﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;

namespace MO
{
    public class FileOperation
    {
        public static void AppendAllText(string path, string contents)
        {
            while (true)
            {
                try
                {
                    File.AppendAllText(path, contents, Encoding.UTF8);
                    return;
                }
                catch
                {
                    Thread.Sleep(100);
                }
            }
        }
        public static FileStream OpenRead(string path)
        {
            while (true)
            {
                try
                {
                    return File.OpenRead(path);
                }
                catch
                {
                    Thread.Sleep(100);
                }
            }
        }
    }
}
